package com.company.gas.service.impl;

import com.company.gas.mapper.RepairMapper;
import com.company.gas.pojo.Repair;
import com.company.gas.service.IRepairService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class RepairServiceImpl implements IRepairService {
    @Autowired
    private RepairMapper repairMapper;

    @Override
    public List<Repair> queryRepairList(){
        List<Repair> repairList = repairMapper.selectAll();
        return repairList;
    }

    @Override
    public Repair queryRepairById(String repId) {
        Repair repair =repairMapper.queryRepairById(repId);
        System.out.println(repair);
        return repair;
    }

    @Override
    public int addRepair(String repId, String cusId, String staffId, Date repDate, Integer flag,Date createTime, String createBy,Date modifyTime, String modifyBy) {
        repairMapper.addRepair(repId,cusId,staffId,repDate,flag,createTime,createBy,modifyTime,modifyBy);
        return 1;
    }

    @Override
    public int updateRepair(String cusId, String staffId, Date repDate,Date modifyTime, String modifyBy) {
        repairMapper.updateRepair(cusId,staffId,repDate,modifyTime,modifyBy);
        return 1;
    }

    @Override
    public int deleteRepair(String repId) {
        repairMapper.deleteRepair(repId);
        return 1;
    }

}